﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows.Media.Effects;
using MouseExtender.Logic.Managers;

namespace MouseExtender.Logic.Converters
{
    public class SettingsToEffectConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            string paramValue = parameter.ToString();
            object result = null;
            switch (paramValue)
            {
                case "software":
                    {
                        if (!SettingsManager.CurrentSettings.UseHWAcceleration)
                            result = (BitmapEffect)value;
                    }
                    break;
                case "hardware":
                    {
                        if (SettingsManager.CurrentSettings.UseHWAcceleration)
                            result = (Effect)value;
                    }
                    break;
                default:
                    result = null;
                    break;
            }
            return result;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
